<?php
namespace app\home\controller;
use app\home\model\MyorderModel;
use \think\Controller;
use \think\Session;
class Myorder extends Controller{
    //订单数据
    public function allOrder(){
        $id = input('id');
       $user_id = Session::get("USER.id");
        if($id==0){$status['order_status']=$id;}elseif ($id==1){$status['order_status']=$id;}
        elseif ($id==2){$status['order_status']=$id;}
        elseif ($id==3){$status['order_status']=$id;$status['is_appraises']=0;}
        elseif ($id==4){$status['order_status']=$id;}elseif ($id==5){$status['order_status']=$id;}
        else{$status['user_id']=$user_id;}
        $order = new MyorderModel();
        $orders =$order->getOrderGoods($status);
//        echo "<pre>";
       /* print_r($orders);
        exit;*/
        $this->assign('orders',$orders);
        return $this->fetch('all_order');
    }
    /*
     取消订单
     */
    public function cancelOrder(){
        $data = !empty(input('data'))?input('data'):'';
        $canOrder = new MyorderModel();
        $status = $canOrder->deleteOrder($data);
        if($status){
            echo 1;
        }else{
            return  0;
        }

    }
    /*
     * 物流*/
    public function logistics(){
        $data['id'] = input('id');
        $status = new MyorderModel();
       $goodInfo = $status->logistics($data);
        $this->assign('goodInfo',$goodInfo);
        return $this->fetch('logistics');
    }
}